From: Florian Müllner Date: Thu, 5 Mar 2020 16:19:38 +0000 (+0100) Subject: dbusServices/extensions: Handle parentWindow parameter X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~751^2^2~52 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a90fcb7ddbbf4b2207b3bb46de7359ccc1377f38;p=gnome-shell.git dbusServices/extensions: Handle parentWindow parameter Now that the service implements the preference dialog, it's time to support OpenExtensionPrefs()'s parentWindow parameter and make the dialog a transient of the external window if specified. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1087 --- diff --git a/js/dbusServices/extensions/extensionsService.js b/js/dbusServices/extensions/extensionsService.js index 482373846..9d444c551 100644 --- a/js/dbusServices/extensions/extensionsService.js +++ b/js/dbusServices/extensions/extensionsService.js @@ -1,7 +1,7 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported ExtensionsService */ -const { Gdk, Gio, GLib, GObject, Gtk } = imports.gi; +const { Gdk, Gio, GLib, GObject, Gtk, Shew } = imports.gi; const ExtensionUtils = imports.misc.extensionUtils; @@ -110,7 +110,7 @@ var ExtensionsService = class extends ServiceImplementation { } OpenExtensionPrefsAsync(params, invocation) { - const [uuid, parentWindow_, options] = params; + const [uuid, parentWindow, options] = params; this._proxy.GetExtensionInfoRemote(uuid, (res, error) => { if (this._handleError(invocation, error)) @@ -120,6 +120,15 @@ var ExtensionsService = class extends ServiceImplementation { const extension = ExtensionUtils.deserializeExtension(serialized); const window = new ExtensionPrefsDialog(extension); + window.realize(); + + let externalWindow = null; + + if (parentWindow) + externalWindow = Shew.ExternalWindow.new_from_handle(parentWindow); + + if (externalWindow) + externalWindow.set_parent_of(window.window); if (options.modal) window.modal = options.modal.get_boolean();